<template>
  <view class="ass-comment-tab ss-p-t-20">
	  <view class="ss-flex justify-between ">
		  <view class="ss-flex">
		    <view
		      class="iconBox ss-flex"
		      v-if="props.btnShow"
		    >
		  	
		  	<!-- 评论 -->
		      <view class=" btn-t" @click="ontabstap">
				  
				  <image
				    :src="sheep.$url.cdn('/static/icon/ass-chat.png')"
				    mode="aspectFill"
				  />
				  
				  <view class="btn-txt">评论</view>
				<!-- {{formatCharCount(props.articleData.comment_num) }} -->
		      </view>
		  	
		     
		  	
		  	<!-- 转发 -->
		      <view
		        class=" ss-m-l-40 btn-t"
		        @click="shareCli"
		      >
		        <image
		          :src="sheep.$url.cdn('/static/icon/ass-share.png')"
		          mode="aspectFill"
		        />
				<view class="btn-txt">分享</view>
				
				<!--  {{ formatCharCount(props.articleData.forward) }} -->
		       
		      </view>
		  	
		  	
		  	
		    </view>
		  </view>
		  <button @tap="contact" class="ss-reset-button btn">联系我们</button>
	  </view>
    
  </view>
</template>

<script setup>
const emit = defineEmits(['comment', 'likeSet', 'shareFun']);
import { computed, reactive } from 'vue';
import { formatCharCount } from '@/association/utils'
import sheep from '@/sheep';
import association from '@/association/store'
const props = defineProps({
  articleData: {
    type: Object,
    default: () => ({
      // 转发量
      forward: 0,
      // 收藏量
      likes: 0,
      // 参与人数
      number: 0,
      // 是否已收藏
      is_likes: false,
    }),
  },
  share: {
    type: Boolean,
    default: true,
  },
  btnShow: {
    type: Boolean,
    default: true,
  },
  fixed: {
    type: Boolean,
    default: true,
  },
});
// onShareTimeline(()=>{
// 	return{
// 		title:'分享标题',
// 		path:'/association/pages/talk',
// 		imageUrl:'https://liuliangbenben.oss-cn-hangzhou.aliyuncs.com/uploads/20231027/037a56404a9e66dc2eb45dc636a40caf.png',
// 		desc:'理疗的原理是什么'
// 	}
// })

const theme = computed(() => association().theme)

const ontabstap = () => {
  emit('comment');
};
const shareCli = () => {
  console.log('点击分享');

  emit('shareFun');
}
const contact=()=>{
	let to = {
		aim: 'message',
		service: {
		  mobile: '18840715281',
		},
	  };
	  const urlJson = encodeURIComponent(JSON.stringify(to))
	  uni.navigateTo({
		url: '/im/pages/web?to=' + urlJson,
	  });
}
// onPageScroll(() => { });
</script>

<style lang="scss" scoped>
@import '@/association/scss/index.scss';
view {
  box-sizing: border-box;
}

.ass-comment-tab {
  height: calc(env(safe-area-inset-bottom) + 50px);

  & > view {
    padding: 30rpx 25rpx calc(env(safe-area-inset-bottom) + 15rpx);
    position: fixed;
    bottom: -1rpx;
    z-index: 30;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-bottom) + 70px);
    background-color: #fff;
  }
}



.iconBox {
  font-size: 26rpx;

  & > view > view {
    margin: 0 10rpx;
  }

  & > button > view {
    margin: 0 10rpx;
  }

  button {
  }

  .icon {
    font-size: 40rpx;
  }
}


.btn{

	width: 430rpx;
	height: 92rpx;
	border-radius: 46rpx;
	background: #1677FE;
	font-size: 28rpx;
	font-weight: bold;
	color:#fff
}
image{
	width:44rpx;
	height:44rpx;
}
.btn-txt{
	color:#3D3D3D;
	font-size: 28rpx;
	margin-top:10rpx
}
.btn-t{
	display: block;
	text-align: center;
}
</style>
